#pragma once

#include <wx/aui/aui.h>
#include <wx/Dialog.h>
#include "wx/bmpbuttn.h"
#include "wx/menu.h"

//#include "wx/app.h"
//#include "wx/grid.h"
//#include "wx/treectrl.h"
//#include "wx/spinctrl.h"
//#include "wx/artprov.h"
//#include "wx/clipbrd.h"
//#include "wx/image.h"
//#include "wx/colordlg.h"
//#include "wx/wxhtml.h"
//#include "wx/imaglist.h"
//#include "wx/dataobj.h"
//#include "wx/dcclient.h"
//#include "wx/toolbar.h"
//#include "wx/statusbr.h"
//#include "wx/msgdlg.h"
//#include "wx/textdlg.h"

#include "app_Grid.h"
#include "app_Tree.h"

namespace app {
///////////////////////////////////////////////////////////////////////////////

struct TFrame : public wxFrame
{
	TFrame( wxWindow* parent = NULL
		, wxWindowID id = wxID_ANY
		, const wxString& title = wxT("docBuilder")
		, const wxPoint& pos = wxDefaultPosition
		, const wxSize& size = wxSize( 500,300 )
		, long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL 
	);
	~TFrame();
	//
	//wxAuiNotebook* CreateNotebook();
	void DefaultPerspective();
	//
	void OnLoadTable(wxCommandEvent & event);
	//void OnGridCellLeftDClick( wxGridEvent& event );//{ /*event.Skip();*/ }
	void OnTreeEvent_SelChanged(TTreeEvent& event);
	//
	void LoadTables();
	//
	wxAuiManager frameManager;
	prs::TDataTables dataTables;
	prs::TDataTree	 dataExplorer;
  
	TGridCtrl *gridCtrl;
	TTreeCtrl *treeCtrl;
	//wxAuiNotebook* notebook;
	//long m_notebook_style;
  //long m_notebook_theme;
	wxArrayString m_perspectives;
    
	//
	DECLARE_EVENT_TABLE();
};

///////////////////////////////////////////////////////////////////////////////

class TRichEditDialog : public wxDialog 
{
private:

protected:
	//wxTextCtrl* text;
	wxButton* buttonOk;
	wxButton* buttonCancel;
	void OnOk( wxCommandEvent& event );
	void OnCancel( wxCommandEvent& event );

public:
	TRichEditDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 326,197 ), long style = 0 );
	~TRichEditDialog();
	//
	wxString GetText();
};

///////////////////////////////////////////////////////////////////////////////
}
